package executor;

/**
 * @author tongchen
 * @create 2023-02-10 22:48
 */
public class TestThreadLocal {
    public static void main(String[] args) {
        ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
        ThreadLocal<Integer> local = new ThreadLocal<>();
         Thread t1 =new Thread(()->{
                    int count =30;
                    threadLocal.set(count);
             System.out.println(threadLocal.get());
         });
         Thread t2 =new Thread(()->{
                    int count =35;
                    threadLocal.set(count);
             System.out.println(threadLocal.get());
         });
         Thread t3 =new Thread(()->{
                    int count =40;
                    threadLocal.set(count);
             System.out.println(threadLocal.get());
         });
        t1.start();
        t2.start();
        t3.start();
    }
}
